import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import get from '@dfeidao/atom-web/local/get';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import refresh from '@dfeidao/atom-web/url/refresh';

export default async function a004(fd: IFeidaoAiBrowserComponent) {
	// todo确定
	const no = get(fd, 'no');
	const resno = get(fd, 'n');
	//const name = get(fd, 'name');

	if (no) {
		const r = await nodejs<{ code: 0 | 1; result: string }>('device-type/zj-000011/s001', {
			filter: {
				equip_type_no: no
			}
		});
		if (r.code === 1) {
			alert('删除成功');
			refresh();
		} else {
			alert('删除失败');
		}
	} else {
		const r = await nodejs<{ code: 0 | 1; result: string }>('device-type/zj-000011/s001', {
			filter: {
				equip_type_no: resno
			}
		});
		if (r.code === 1) {
			alert('删除成功');
			refresh();
		} else {
			alert('删除失败');
		}
	}



}
